package demo1;

class Solution {
    public int minDeletion(int[] nums) {
          int len = nums.length;
          boolean even = true ;
          int count = 0 ;
          for(int i = 0 ; i < len-1 ; i++ ){
            if(even){
              if(nums[i] == nums[i+1]){
                  count ++ ;
              }else{
               even = false ;
              }
            } else{
                even = true ;
            }
          }         
        if( (len - count) %2 != 0){
            count ++ ;
        }
         return count ;

    }
}